<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include('includes/seo.php');$local=get_bloginfo('template_url');?>
<meta charset="UTF-8">
<meta property="v:site_name" content="<?php bloginfo('name')?>"/>
<meta property="v:local" content="zh_CN"/>
<meta name="viewport" content="width=device-width,maximum-scale=1;" />
<link rel="shortcut icon" href="<?php echo $local?>/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="<?php echo $local?>/style.css"/>
<link rel="pingback" href="<?php bloginfo('pingback_url')?>"/>
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="<?php echo $local?>/includes/IE8-style.css" />
<script src="<?php echo $local?>/js/html5.js"></script>
<![endif]-->
<script src="//cdn.staticfile.org/jquery/1.8.3/jquery.min.js"></script>
<script src="<?php echo $local?>/js/initial.js"></script>
<?php wp_head(); ?>
</head>

<body <?php body_class(); if(get_option('ini_prettify')){ echo ' onload="prettyPrint()"';}?>>
<div id="page">
<div id="nav">
    <div class="nav-item">
        <h1 class="nav-logo"><a href="<?php bloginfo('url')?>"><?php bloginfo('name')?></a></h1>
        <a><span class="nav-enter btn hide">导航菜单</span></a>
        <div class="nav-menu">
            <div class="nav-menu-list">
                <?php if(function_exists('wp_nav_menu')) {wp_nav_menu(array('theme_location'=>'primary','menu_id'=>'menu','container'=>'false'));}?>
            </div>
            <div class="nav-exit btn hide"><a>↑ 收起菜单</a></div>
        </div>
        <div class="nav-icon">
            <a class="nav-mail icon-mail tip" href="//mail.qq.com/cgi-bin/qm_share?t=qm_mailme&amp;email=<?php if (get_option('ini_mail')){ echo stripslashes(get_option('ini_mail'));} else { bloginfo('admin_email'); }?>" rel="external nofollow"></a>
            <?php if (get_option('ini_weibo')!=""){?><a class="nav-weibo icon-weibo tip" href="<?php echo stripslashes(get_option('ini_weibo'));?>" rel="external nofollow"></a><?php }?>
            <a class="nav-rss icon-rss tip" href="<?php if (get_option('ini_rss')) { echo stripslashes(get_option('ini_rss')); } else { bloginfo('rss2_url'); }?>" rel="external"></a>
            <a class="nav-search icon-search tip hide" href="javascript:;" <?php if (get_option('ini_search')=="Display") { echo 'style="display:block;"'; }?>></a>
        </div>
        <div class="nav-search-bar hide">
            <form method="get" action="<?php bloginfo('home');?>">
                <input type="search" placeholder="Search…" value="" name="s" />
            </form>
        </div>
    </div>
</div>

<div id="container">
<?php if ( is_home() || is_archive() ){?>
<div id="metro">
<div id="metro-item">
        <div class="left">
          <div class="featured">
        <ul>
        <?php query_posts('meta_key=top&showposts='.get_option('ini_num').';&ignore_sticky_posts=1');
            if (have_posts()) :
             while (have_posts()) : the_post();?>
        <li>
          <a href="<?php the_permalink();?>" rel="bookmark">
              <?php $thumb_img = has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, array(430,314), array('alt' => trim(strip_tags( $post->post_title ))) ) : get_post_img(430,314,1);?>
              <div class="featured-title"><span><?php the_title();?></span></div>
              <?php echo $thumb_img;?> 
          </a>
        </li>
            <?php endwhile;?>
            <?php else:?>
                <?php query_posts('orderby=rand&ignore_sticky_posts=1&showposts='.get_option('ini_num').'');
                if (have_posts()) :
                while (have_posts()) : the_post();?>
        <li><a href="<?php the_permalink();?>" rel="bookmark">
                <?php $thumb_img = has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, array(430,314), array('alt' => trim(strip_tags( $post->post_title ))) ) : get_post_img(430,314,1);?>
              <div class="featured-title"><span>随机推荐：<?php the_title();?></span></div>
              <?php echo $thumb_img;?>
          </a>
        </li>
                <?php endwhile;endif;?>
            <?php endif;?>
            <?php wp_reset_query();?>
          </ul>
          </div>
        </div>
        <div class="center">
        	<div style="width:280px; height:20px;">
            	<div class="shadowBig" style="border-top-color:transparent;">		                </div>
            </div>
            <div style="width:280px; border-left:10px solid #4d4d4d;">
            	<div class="shadowSmall" style=" margin-left:-10px; float:left;border-bottom-color:transparent;"></div>
                <div id="center-list-header">
                随机推荐
                </div>
                <ul class="center-list">
                    <?php query_posts('orderby=rand&ignore_sticky_posts=1&showposts=5');
                    if (have_posts()) :
                       while (have_posts()) : the_post();?>
                <li class="center-item">
                    <a href="<?php the_permalink();?>" rel="bookmark ">
                        <?php //$thumb_img = has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, array(110,110), array('alt' => trim(strip_tags( $post->post_title ))) ) : get_post_img(110,110,2);?>
                        <!--<span class="center-item-title slow"><?php //the_title();?></span>-->
                        <?php //echo $thumb_img;?> 
                         <span class="center-item-title slow"><?php the_title();?></span>
                    </a>
                </li>
                    <?php endwhile;endif;?>
                    <?php wp_reset_query();?>
                  </ul>
              </div>
              <div class="shadowSmall" style=" margin-top:-10px; float:left; border-top-color:transparent;">
              </div>
              <div style="width:280px; height:20px;">
            	<div class="shadowBig" style="border-bottom-color:transparent;">
                </div>
            </div>
        </div>
        <div class="right bd"><?php echo stripslashes(get_option('ini_right'));?>
    </div>
</div>
</div>
<?php } if (get_option('ini_admin') && !get_option('ini_bulletin')){include('includes/map.php');}?>